package com.zhai.domain.activity.repository;

import com.zhai.domain.activity.model.aggregate.CreatePartakeOrderAggregate;
import com.zhai.domain.activity.model.aggregate.CreateQuotaOrderAggregate;
import com.zhai.domain.activity.model.entity.*;
import com.zhai.domain.activity.model.valobj.ActivitySkuStockKeyVO;

import java.util.Date;
import java.util.List;

/**
 * @Description: 活动仓储
 * @ClassName: IActivityRepository
 * @Author: zhaiyongxin
 * @Date: 2025/2/19 16:51
 * @Version: 1.0
 */
public interface IActivityRepository {

    ActivitySkuEntity queryActivitySku(Long sku);

    ActivityEntity queryRaffleActivityByActivityId(Long activityId);

    ActivityCountEntity queryRaffleActivityCountByActivityCountId(Long activityCountId);

    void doSaveOrder(CreateQuotaOrderAggregate createQuotaOrderAggregate);

    void cacheActivitySkuStockCount(String cacheKey, Integer stockCount);

    boolean subtractActivitySkuStock(Long sku, String cacheKey, Date endTime);

    void activitySkuStockConsumeSendQueue(ActivitySkuStockKeyVO activitySkuStockKeyVO);

    ActivitySkuStockKeyVO takeQueueValue(Long sku);

    void updateActivitySkuStock(ActivitySkuStockKeyVO activitySkuStockKeyVO);

    void clearActivitySkuStock(Long sku);

    void clearQueueValue(Long sku);

    UserRaffleOrderEntity queryUnusedActivityOrder(PartakeRaffleActivityEntity partakeRaffleActivityEntity);

    ActivityAccountEntity queryActivityAccountByUserId(Long activityId, String userId);

    ActivityAccountMonthEntity queryActivityAccountMonthByUserId(Long activityId, String userId, String month);

    ActivityAccountDayEntity queryActivityAccountDayByUserId(Long activityId, String userId, String day);

    void saveCreatePartakeOrderAggregate(CreatePartakeOrderAggregate createPartakeOrderAggregate);

    List<ActivitySkuEntity> queryActivitySkuByActivityId(Long activityId);

    Integer queryRaffleActivityAccountDayPartakeCount(Long activityId, String userId);

    List<Long> querySkuStockList();

    ActivityAccountEntity queryActivityAccountEntity(String userId, Long activityId);

    Integer queryRaffleActivityAccountTotalPartakeCount(Long activityId, String userId);
}
